Package-level declarations
Functions
Appends per-tool input examples to the tool description. For providers that don't natively accept examples on tool definitions (most of them besides Anthropic), this lets the example pairs influence the model via the description text instead.
Applies default per-call settings to every model invocation. Explicitly provided params override defaults; provider option maps are merged.
Extracts JSON from text-only model output. For models that wrap their structured response in markdown code fences (```json {...} ``` ) or mix prose with the JSON, this strips the surrounding text and surfaces just the JSON object.
Extracts XML-tagged reasoning sections from generated text and surfaces them as separate ReasoningStart/Delta/End events.
Routes a model invocation's tool-call boundary + error events through an injected Logger — the port-side, provider-agnostic home for observability.
Wraps a non-streaming model into a fake streaming surface. Useful when a provider's batch-only generate is the only path available and the UI needs a stream contract.